import Vue from 'vue'
import App from './App'
import website from '@/config/website'

// 获取颜色工具
import color from '@/common/color'
// 获取整个父组件
import $parent from '@/common/$parent'

const $t = {
  color,
  $parent,
}

// 挂载到uni对象上
uni.$t = $t
Vue.prototype.$t = $t

// 此处为引用自定义顶部
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom);
import TnCustom from './components/TnCustom/TnCustom.vue'
Vue.component('tn-custom', TnCustom)
import UserAuth from "@/components/user-auth/user-auth";
Vue.component('user-auth', UserAuth);
import UserPhone from "@/components/user-phone/user-phone";
Vue.component('user-phone', UserPhone);
import UserPay from "@/components/user-pay/user-pay";
Vue.component('user-pay', UserPay);
import CardPay from "@/components/card-pay/card-pay";
Vue.component('card-pay', CardPay);
import CoinPopup from "@/components/coin-popup/coin-popup";
Vue.component('coin-popup', CoinPopup);
import GoldPopup from "@/components/gold-popup/gold-popup";
Vue.component('gold-popup', GoldPopup);
import CashPopup from "@/components/cash-popup/cash-popup";
Vue.component('cash-popup', CashPopup);
import QrPopup from "@/components/qr-popup/qr-popup";
Vue.component('qr-popup', QrPopup);
import FbPopup from "@/components/fb-popup/fb-popup";
Vue.component('fb-popup', FbPopup);
import SearchPopup from "@/components/search-popup/search-popup";
Vue.component('search-popup', SearchPopup);
import Monster from "@/components/monster/monster";
Vue.component('monster', Monster);
import Loading from "@/components/loading/loading";
Vue.component('loading', Loading);
import Star from "@/components/star/star";
Vue.component('star', Star);
import Heart from "@/components/heart/heart";
Vue.component('heart', Heart);
import Rabbit from "@/components/rabbit/rabbit";
Vue.component('rabbit', Rabbit);
import TalkList from "@/components/talk-list/talk-list";
Vue.component('talk-list', TalkList);
import TopicScroll from "@/components/topic-scroll/topic-scroll";
Vue.component('topic-scroll', TopicScroll);
import TagScroll from "@/components/tag-scroll/tag-scroll";
Vue.component('tag-scroll', TagScroll);
import TagPopup from "@/components/tag-popup/tag-popup";
Vue.component('tag-popup', TagPopup);
import Talk from "@/components/talk/talk";
Vue.component('talk', Talk);
import SendBox from "@/components/send-box/send-box";
Vue.component('send-box', SendBox);
import Speak from "@/components/speak/speak";
Vue.component('speak', Speak);
import Reply from "@/components/reply/reply";
Vue.component('reply', Reply);
import ScrollNotice from "@/components/scroll-notice/scroll-notice";
Vue.component('scroll-notice', ScrollNotice);

// 加载website
Vue.prototype.website = website;

//判断是否登录
import { judgeLogin } from '@/config/login';
Vue.prototype.judgeLogin = judgeLogin;

//判断是否登录
import { judgeAuth } from '@/config/login';
Vue.prototype.judgeAuth = judgeAuth;

//判断是否登录
import { judgeCoin } from '@/config/login';
Vue.prototype.judgeCoin = judgeCoin;

//判断是否登录
import { judgeVipNum } from '@/config/login';
Vue.prototype.judgeVipNum = judgeVipNum;

// 小程序广告
import adVideoUtils from '@/common/adVideoUtils';
Vue.prototype.$utils = {
  ...adVideoUtils,
};

// 引入:uView-UI
import uView from 'uview-ui';
Vue.use(uView);

// 此处为演示vuex使用，非uView的功能部分
import store from '@/store';

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	store,
    ...App
})

// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js';
Vue.use(httpInterceptor, app);

app.$mount()
